<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>检查某个字符串 S1 是否出现在字符串 S2中</title>
</head>
<body>
    
</body>
</html>
<script>
        var s1 = 'hwfvuiwhfiuwfhiu';
        // var s2 = new RegExp('aaa');
        var s2 = new RegExp('f');
        if(s2.test(s1)){        //test()方法用于匹配字符串是否某个模式
            alert('在')
        } else{
            alert('不在')
        }
</script>